package cn.achao.csr.api;

import cn.achao.csr.api.factory.ChatUserFallbackFactory;
import cn.achao.csr.base.constant.SecurityConstants;
import cn.achao.csr.base.resp.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * @Author: achao
 **/
@FeignClient(contextId = "csrChatUserContextId", path = "/user", value = "csr-chat", fallbackFactory = ChatUserFallbackFactory.class)
public interface ChatUserApi {

    /**
     * 根据账号查询用户信息
     * @param userAccount
     * @param source
     * @return
     */
    @GetMapping("/info/{userAccount}")
    R<?> info(@PathVariable("userAccount") String userAccount,
                      @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
